home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1510 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  919 b 

  1. Path: lonweb.lehman.com!news
  2. From: jrojas@lehman.com
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: How to initialize an array of structures?
  5. Date: Thu, 11 Jan 96 11:22:34 PDT
  6. Organization: Lehman Brothers
  7. Message-ID: <4d2s3k$g0p@lonweb1.lehman.com>
  8. References: <4d240e$nk5@jupiter.planet.net>
  9. NNTP-Posting-Host: lonefgdev129.lonefgdev.lehman.com
  10. Mime-Version: 1.0
  11. Content-Type: TEXT/PLAIN; charset=US-ASCII
  12. X-Newsreader: NEWTNews & Chameleon -- TCP/IP for MS Windows from NetManage
  13.  
  14.  
  15. > Could someone explain how to do this properly:
  16. >         struct FUNCTIONMAP
  17. >         {
  18. >             char     *functionname;
  19. >             int    functionnumber;
  20. >             int    maxargs;
  21. >             int    functarg[5];
  22. >             
  23. >         };
  24. >         
  25. >         static struct FUNCTIONMAP functionlist[300];    
  26. try :
  27.  
  28. static struct FUNCTIONMAP functionlist[300] = 
  29.  { {"firstfunction",1,3,{2,2,2,0,0}},
  30.    {"secondfunction", 3,4,{6,7,2,4}},
  31.               ...
  32.           ...
  33.    {"300functions",2,3,{4,5,6,7,8}} };
  34.  
  35.